home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / freeWAIS-sf-1.1 / x / myAsciiSrc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-04  |  4.3 KB  |  173 lines

  1. /* Borrowed by Jonny Goldman. */
  2. /*
  3.  * $XConsortium: AsciiSrc.h,v 1.13 91/07/22 19:02:47 converse Exp $
  4.  *
  5.  * Copyright 1989 Massachusetts Institute of Technology
  6.  *
  7.  * Permission to use, copy, modify, and distribute this software and its
  8.  * documentation for any purpose and without fee is hereby granted, provided
  9.  * that the above copyright notice appear in all copies and that both that
  10.  * copyright notice and this permission notice appear in supporting
  11.  * documentation, and that the name of M.I.T. not be used in advertising or
  12.  * publicity pertaining to distribution of the software without specific,
  13.  * written prior permission.  M.I.T. makes no representations about the
  14.  * suitability of this software for any purpose.  It is provided "as is"
  15.  * without express or implied warranty.
  16.  *
  17.  */
  18.  
  19. /* Copyright (c) CNIDR (see ../COPYRIGHT) */
  20.  
  21.  
  22.  
  23. /*
  24.  * AsciiSrc.h - Public Header file for Ascii Text Source.
  25.  *
  26.  * This is the public header file for the Ascii Text Source.
  27.  * It is intended to be used with the Text widget, the simplest way to use
  28.  * this text source is to use the AsciiText Object.
  29.  *
  30.  * Date:    June 29, 1989
  31.  *
  32.  * By:      Chris D. Peterson
  33.  *          MIT X Consortium 
  34.  *          kit@expo.lcs.mit.edu
  35.  */
  36.  
  37.  
  38. #ifndef _MyAsciiSrc_h
  39. #define _MyAsciiSrc_h
  40.  
  41. #ifdef sgi
  42. #include <X11/Xaw/TextI.h>
  43. #endif
  44. #include <X11/Xaw/TextSrc.h>
  45.  
  46. /* Resources:
  47.  
  48.  Name             Class        RepType        Default Value
  49.  ----             -----        -------        -------------
  50.  callback         Callback        Callback    (none)
  51.  dataCompression     DataCompression    Boolean        True
  52.  length             Length        int        (internal)
  53.  pieceSize         PieceSize        int        BUFSIZ
  54.  string             String        String        NULL
  55.  type             Type        XawAsciiType    XawAsciiString
  56.  useStringInPlace    UseStringInPlace    Boolean        False
  57.  
  58. */
  59.  
  60. /* Class record constants */
  61.  
  62. extern WidgetClass myasciiSrcObjectClass;
  63.  
  64. typedef struct _MyAsciiSrcClassRec *MyAsciiSrcObjectClass;
  65. typedef struct _MyAsciiSrcRec      *MyAsciiSrcObject;
  66.  
  67. /*
  68.  * Just to make people's lives a bit easier.
  69.  */
  70.  
  71. #define MyAsciiSourceObjectClass MyAsciiSrcObjectClass
  72. #define MyAsciiSourceObject      MyAsciiSrcObject
  73.  
  74. /*
  75.  * Resource Definitions.
  76.  */
  77.  
  78. #define XtCDataCompression "DataCompression"
  79. #define XtCPieceSize "PieceSize"
  80. #define XtCType "Type"
  81. #define XtCUseStringInPlace "UseStringInPlace"
  82.  
  83. #define XtNdataCompression "dataCompression"
  84. #define XtNpieceSize "pieceSize"
  85. #define XtNtype "type"
  86. #define XtNuseStringInPlace "useStringInPlace"
  87.  
  88. #define XtRAsciiType "AsciiType"
  89.  
  90. #define XtEstring "string"
  91. #define XtEfile "file"
  92.  
  93. typedef enum /* {XawAsciiFile, XawAsciiString} */ XawAsciiType;
  94.  
  95. /************************************************************
  96.  *
  97.  * Public routines 
  98.  *
  99.  ************************************************************/
  100.  
  101. /*    Function Name: XawAsciiSourceFreeString
  102.  *    Description: Frees the string returned by a get values call
  103.  *                   on the string when the source is of type string.
  104.  *    Arguments: w - the AsciiSrc object.
  105.  *    Returns: none.
  106.  */
  107.  
  108. extern void MyAsciiSourceFreeString(
  109. #if NeedFunctionPrototypes
  110.     Widget        /* w */
  111. #endif
  112. );
  113.  
  114. /*    Function Name: MyAsciiSave
  115.  *    Description: Saves all the pieces into a file or string as required.
  116.  *    Arguments: w - the asciiSrc Object.
  117.  *    Returns: TRUE if the save was successful.
  118.  */
  119.  
  120. extern Boolean MyAsciiSave(
  121. #if NeedFunctionPrototypes
  122.     Widget        /* w */
  123. #endif
  124. );
  125.  
  126. /*    Function Name: MyAsciiSaveAsFile
  127.  *    Description: Save the current buffer as a file.
  128.  *    Arguments: w - the asciiSrc object.
  129.  *                 name - name of the file to save this file into.
  130.  *    Returns: True if the save was successful.
  131.  */
  132.  
  133. extern Boolean MyAsciiSaveAsFile(
  134. #if NeedFunctionPrototypes
  135.     Widget        /* w */,
  136. #ifdef sgi
  137.     String
  138. #else
  139.     _Xconst char*    /* name */
  140. #endif
  141. #endif 
  142. );
  143.  
  144. /*    Function Name: MyAsciiSourceChanged
  145.  *    Description: Returns true if the source has changed since last saved.
  146.  *    Arguments: w - the asciiSource object.
  147.  *    Returns: a Boolean (see description).
  148.  */
  149.  
  150. extern Boolean MyAsciiSourceChanged(
  151. #if NeedFunctionPrototypes
  152.     Widget        /* w */
  153. #endif
  154. );
  155.  
  156. #endif /* _MyAsciiSrc_h  - Don't add anything after this line. */
  157.  
  158. /*
  159.  * $Log: myAsciiSrc.h,v $
  160.  * Revision 1.3  1994/08/05  07:25:34  pfeifer
  161.  * Release beta 04
  162.  *
  163.  * Revision 1.2  93/07/01  18:22:35  warnock
  164.  * Fixed problem on SGI's under X11R4
  165.  * 
  166.  * Revision 1.1  1993/02/16  15:10:18  freewais
  167.  * Initial revision
  168.  *
  169.  * Revision 1.1  92/06/22  10:46:14  jonathan
  170.  * Initial revision
  171.  * 
  172.  */
  173.